<?php

namespace App\Model;

use Illuminate\Database\Eloquent\Model;

class Category extends Model
{
    protected $table = 'category'; 

    protected $fillable = ['name', 'tags', 'description','parent_id','icon'];    

    public $timestamps= false;

	public function childCategory() 
	{
		return $this->hasMany(self::class, 'parent_id', 'id');
	}
	 
	public function allChildrenCategorys()
	{
		return $this->childCategory()->with('allChildrenCategorys');
	}	
}
